package com.wdzr.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wdzr.mapper.WeeklyMapper;
import com.wdzr.model.Weekly;
import com.wdzr.service.WeeklyService;

@Service
public class WeeklyServiceImpl implements WeeklyService {

    /**
     * 注入WeeklyMapper接口
     */
    @Autowired
    private WeeklyMapper weeklyMapper;

    /**
     * 新增周报
     */
    public boolean saveWeekly(Weekly weekly) {
        return weeklyMapper.saveWeekly(weekly);
    }

    /**
     * 更新个人周报
     */
    public boolean updateWeeklyOne(Weekly weekly) {
        return weeklyMapper.updateWeeklyOne(weekly);
    }
    /**
     * 更新项目周报
     */
    public boolean updateWeeklyPro(Weekly weekly) {
        return weeklyMapper.updateWeeklyPro(weekly);
    }
    /**
     * 根据Id删除周报
     */
    public boolean deleteWeekly(int id) {
        return weeklyMapper.deleteWeekly(id);
    }

    /**
     * 根据id查找周报
     */
    public Weekly findWeeklyById(int id) {
    	Weekly weekly = weeklyMapper.findWeeklyById(id);
        return weekly;
    }

    /**
     * 查询所有周报
     */
    public List<Weekly> findAll() {
        List<Weekly> allWeekly = weeklyMapper.findAll();
        return allWeekly;
    }

}
